package com.wkq.move.module.main.ui.fragment

import android.os.Bundle
import android.view.View
import com.wkq.base.frame.fragment.MvpBindingFragment
import com.wkq.move.R
import com.wkq.move.databinding.FragmentMovieListBinding
import com.wkq.move.databinding.FragmentMoviesBinding
import com.wkq.move.module.main.frame.presenter.MovieListPresenter
import com.wkq.move.module.main.frame.presenter.MoviesPresenter
import com.wkq.move.module.main.frame.view.MoveView
import com.wkq.move.module.main.frame.view.MovesView
import com.youth.banner.listener.OnPageChangeListener

/**
 *
 * 作者:吴奎庆
 *
 * 时间:2020/5/22
 *
 * 用途:
 */


class MoviesFragment :
    MvpBindingFragment<MovesView, MoviesPresenter, FragmentMoviesBinding>(),
    OnPageChangeListener {
    var isExpend = false
    var index: String? = null
    var startIndex: String? = null
    var totalIndex: String? = null

    companion object {
        fun newInstance(path: String): MoviesFragment {
            var bandle: Bundle = Bundle()
            bandle.putString("path", path)
            var home: MoviesFragment = MoviesFragment()
            home.arguments = bandle
            return home

        }
    }

    override fun getLayoutId(): Int {
        return R.layout.fragment_movies
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        index = arguments?.getString("path")
        startIndex = arguments?.getString("path")
        if (mvpView != null) mvpView.initView()
        if (getPresenter() != null) getPresenter().getData(index)
    }

    override fun onPageScrollStateChanged(state: Int) {
    }

    override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
    }

    override fun onPageSelected(position: Int) {
    }
}